<template>
  <!-- 急症、危重、疑难病人情况统计 -->
  <div>
    <h1>急症、危重、疑难病人情况统计表</h1>
    <h3>时期: {{startDate}} ～ {{endDate}}</h3>
    <h2>医院名称：湖北中医学院附属医院</h2>
    <el-table :data="tableData" stripe border style="width: 100%">
      <el-table-column prop="kb" label="科别" align="center" width></el-table-column>
      <el-table-column label="出院病人数" align="center" width>
        <el-table-column prop="f11" label="合计" align="center" width></el-table-column>
        <el-table-column prop="f12" label="中医治疗" align="center" width></el-table-column>
        <el-table-column prop="f13" label="西医治疗" align="center" width></el-table-column>
        <el-table-column prop="f14" label="中西治疗" align="center" width></el-table-column>
        <el-table-column prop="f15" label="中医治疗率%" align="center" width></el-table-column>
        <el-table-column prop="f16" label="中医参与率%" align="center" width></el-table-column>
      </el-table-column>
      <el-table-column label="急症数" align="center" width>
        <el-table-column prop="f21" label="合计" align="center" width></el-table-column>
        <el-table-column prop="f20" label="占有率%" align="center" width></el-table-column>
        <el-table-column prop="f22" label="中医治疗" align="center" width></el-table-column>
        <el-table-column prop="f23" label="西医治疗" align="center" width></el-table-column>
        <el-table-column prop="f24" label="中西治疗" align="center" width></el-table-column>
        <el-table-column prop="f25" label="中医治疗率%" align="center" width></el-table-column>
        <el-table-column prop="f26" label="中医参与率%" align="center" width></el-table-column>
      </el-table-column>
      <el-table-column label="危重数" align="center" width>
        <el-table-column prop="f31" label="合计" align="center" width></el-table-column>
        <el-table-column prop="f30" label="占有率%" align="center" width></el-table-column>
        <el-table-column prop="f32" label="中医治疗" align="center" width></el-table-column>
        <el-table-column prop="f33" label="西医治疗" align="center" width></el-table-column>
        <el-table-column prop="f34" label="中西治疗" align="center" width></el-table-column>
        <el-table-column prop="f35" label="中医治疗率%" align="center" width></el-table-column>
        <el-table-column prop="f36" label="中医参与率%" align="center" width></el-table-column>
      </el-table-column>
      <el-table-column label="疑难数" align="center" width>
        <el-table-column prop="f41" label="合计" align="center" width></el-table-column>
        <el-table-column prop="f40" label="占有率%" align="center" width></el-table-column>
        <el-table-column prop="f42" label="中医治疗" align="center" width></el-table-column>
        <el-table-column prop="f43" label="西医治疗" align="center" width></el-table-column>
        <el-table-column prop="f44" label="中西治疗" align="center" width></el-table-column>
        <el-table-column prop="f45" label="中医治疗率%" align="center" width></el-table-column>
        <el-table-column prop="f46" label="中医参与率%" align="center" width></el-table-column>
      </el-table-column>
    </el-table>
  </div>
</template>

<script>
import { emergencyPatientStatistics } from "@/api";
import { showOkMsg, showErrorMsg } from "@/utils/index.js";

export default {
  data() {
    return {
      tableData: [],
      startDate: "",
      endDate: ""
    };
  },
  created() {
    this.getTableList();
  },
  props: ["dateList"],
  methods: {
    getTableList() {
      if (this.dateList.dateEnd && this.dateList.dateBegin) {
        emergencyPatientStatistics({
          startTime: this.dateList.dateBegin,
          endTime: this.dateList.dateEnd
        }).then(res => {
          if (res.code === 0) {
            showOkMsg(res.msg);
            this.startDate = this.dateList.dateBegin;
            this.endDate = this.dateList.dateEnd;
            this.tableData = res.data;
          }
        });
      } else {
        showErrorMsg("请选择开始或结束日期");
      }
    }
  }
};
</script>

<style scoped>
h1 {
  font-size: 24px;
  text-align: center;
  padding: 23px 0;
}
h3 {
  text-align: center;
  padding-bottom: 20px;
}
h2 {
  padding: 4px 0;
  display: flex;
  justify-content: space-between;
}
</style>